package com.jd.sunny.java.multithreading.testlockandsynchronize;


/**
 * @Description:
 * @author:sunny
 * @since:2012-12-13 18:05
 * @version:1.0.0
 */
public class PlusRunnable implements Runnable{

    private Plus plus;


    public PlusRunnable(Plus plus) {
        this.plus = plus;
    }

    public void run() {
        while(true){
            boolean stop = plus.synchronizePlus();
            if(stop){
                break;
            }
        }
    }

//    public void run() {
//        while(true){
//            boolean stop = plus.lockPlus();
//            if(stop){
//                break;
//            }
//        }
//    }

}
